<script setup>
import { ref, provide, inject } from 'vue';
provide('message', 'hello from root!');
const i18n = inject('i18n');
console.log('i18n', i18n, i18n.greetings.hello);
</script>

<template>
    <div>
        <router-link to="/">首页</router-link> |
        <router-link to="/about">关于</router-link>
    </div>
    <router-view v-slot="{ Component }">
        <transition name="route" mode="out-in">
            <component :is="Component" />
        </transition>
    </router-view>
</template>

<style>
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #2c3e50;
    margin-top: 60px;
}

.route-enter-from,
.route-leave-to {
    opacity: 0;
    transform: translateX(30px);
}

.route-enter-active,
.route-leave-active {
    transition: all 0.2s ease;
}
</style>
